package com.itheima.demo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//lombok可以实现为类自动生成getter和setter方法,无参构造器,toString方法
@Data   // @Getter @Setter @ToString @NoArgsConstructor
@AllArgsConstructor     //有参构造器
@NoArgsConstructor      //无参构造器
public class Card {
    private String carId;
    private String name;
    private String phone;   //电话号码
    private double money;   //余额

    //预存金额
    public void deposit(double money) {
        this.money += money;
    }

    //消费金额
    public void consume(double money) {
        this.money -= money;
    }

}
